<?php
// Include PHP HTML DOM parsing library
include('simple_html_dom.php');

// Make sure argument only containers numbers 0-9
$pubmed_id = preg_replace('/[^0-9]/', '', $_GET['id']);

$html = file_get_html('http://cbio.mskcc.org/biogene/retrieve.do?cmd=getPubMedAbstract&id='.$pubmed_id);
echo $html;
/*$data['title'] = $html->find('h2', 0)->plaintext;
$data['authors'] = $html->find('div.auth', 0)->plaintext;
$data['journal'] = $html->find('p.j', 0)->plaintext;
$data['affiliation'] = $html->find('p.aff', 0)->plaintext;
$data['abstract'] = str_replace('Abstract','',$html->find('div.ab', 0)->plaintext);
foreach($html->find('div.ids') as $key=>$element) {
        if ($key <=1) {
        	if ((strpos($element->plaintext,'PMCID') !== FALSE) || (strpos($element->plaintext,'PMID') !== FALSE))
                $data['ids'][] = $element->plaintext;
        }
}

$jsonAbstract = json_encode($data);
echo $jsonAbstract;*/
?>